package com.sdutcm.springbootjpa.Service.ServiceImpl;

/*
 *@Author Yan
 *@Create 2019-09-01 20:10
 */

import com.sdutcm.springbootjpa.Dao.StudentDao;
import com.sdutcm.springbootjpa.Entity.Student;
import com.sdutcm.springbootjpa.Service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDao studentDao;


    @Override
    public Iterable<Student> findAll() throws Exception {
        return studentDao.findAll();
    }

    @Override
    public Optional<Student> findById(Integer id) throws Exception {
        return studentDao.findById(id);
    }

    @Override
    public Integer save(Student student) throws Exception {
        return null;
    }
}
